from re import T
from typing import Generator

import pytest
from fastapi.testclient import TestClient
from tortoise.contrib.test import initializer,finalizer

@pytest.fixture(scope="module")
def client() -> Generator:
    initializer(["backend.models"])
    with TestClient(app) as t:
        yield t
    finalizer()
    
@pytest.fixture(scope="module")
def event_loop(client: TestClient) -> Generator:
    yield client.task.get_loop()

